package com.assets.query;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import com.assets.Ip_set.Url;

/**
 * @作者(author): WR
 * @创建时间(date): 2021/5/21
 */
public class QueryData implements Parcelable {

    /**
     * state : 1
     * asset : {"admin":"2526","amount":100,"area":"广东省","assetId":"1391678647141863425","assetName":"屏风办公桌","assetNumber":"TWYX010122021050001","brand":"","company":"贪玩游戏","createUser":"1","createdate":"2021-05-10 00:00:00","deptId":"市场调查","division":"市场部","financialCode":"12314124141","grundlagen":"购置","image":"/tanwan/image/demo7.jpg","model":"2222","place":"test","receiver":"2530","receivesdate":"","remark":"","rfid":"","salvage":35,"source":"广中","status":"在用","supplier":"","team":"","type":"test","unit":"张","usedate":"2021-05-10 16:57:00","userDept":"1385794545561804801","userId":"2530","year":1}
     */

    private String state;
    private AssetBean asset;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public AssetBean getAsset() {
        return asset;
    }

    public void setAsset(AssetBean asset) {
        this.asset = asset;
    }

    public static class AssetBean implements Parcelable {
        /**
         * admin : 2526
         * amount : 100.0
         * area : 广东省
         * assetId : 1391678647141863425
         * assetName : 屏风办公桌
         * assetNumber : TWYX010122021050001
         * brand :
         * company : 贪玩游戏
         * createUser : 1
         * createdate : 2021-05-10 00:00:00
         * deptId : 市场调查
         * division : 市场部
         * financialCode : 12314124141
         * grundlagen : 购置
         * image : /tanwan/image/demo7.jpg
         * model : 2222
         * place : test
         * receiver : 2530
         * receivesdate :
         * remark :
         * rfid :
         * salvage : 35.0
         * source : 广中
         * status : 在用
         * supplier :
         * team :
         * type : test
         * unit : 张
         * usedate : 2021-05-10 16:57:00
         * userDept : 1385794545561804801
         * userId : 2530
         * year : 1
         */

        private String admin;
        private String amount;
        private String area;
        private String assetId;
        private String assetName;
        private String assetNumber;
        private String brand;
        private String company;
        private String createUser;
        private String createdate;
        private String deptId;
        private String division;
        private String financialCode;
        private String grundlagen;
        private String image;
        private String model;
        private String place;
        private String receiver;
        private String receivesdate;
        private String remark;
        private String rfid;
        private String salvage;
        private String source;
        private String status;
        private String supplier;
        private String team;
        private String type;
        private String unit;
        private String usedate;
        private String userDept;
        private String userId;
        private String year;
        private String accountant;

        public String getAccountant() {
            return accountant;
        }

        public void setAccountant(String accountant) {
            this.accountant = accountant;
        }

        public String getAdmin() {
            return admin;
        }

        public void setAdmin(String admin) {
            this.admin = admin;
        }

        public String getAmount() {
            return amount;
        }

        public void setAmount(String amount) {
            this.amount = amount;
        }

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getAssetId() {
            return assetId;
        }

        public void setAssetId(String assetId) {
            this.assetId = assetId;
        }

        public String getAssetName() {
            return assetName;
        }

        public void setAssetName(String assetName) {
            this.assetName = assetName;
        }

        public String getAssetNumber() {
            return assetNumber;
        }

        public void setAssetNumber(String assetNumber) {
            this.assetNumber = assetNumber;
        }

        public String getBrand() {
            return brand;
        }

        public void setBrand(String brand) {
            this.brand = brand;
        }

        public String getCompany() {
            return company;
        }

        public void setCompany(String company) {
            this.company = company;
        }

        public String getCreateUser() {
            return createUser;
        }

        public void setCreateUser(String createUser) {
            this.createUser = createUser;
        }

        public String getCreatedate() {
            return createdate;
        }

        public void setCreatedate(String createdate) {
            this.createdate = createdate;
        }

        public String getDeptId() {
            return deptId;
        }

        public void setDeptId(String deptId) {
            this.deptId = deptId;
        }

        public String getDivision() {
            return division;
        }

        public void setDivision(String division) {
            this.division = division;
        }

        public String getFinancialCode() {
            return financialCode;
        }

        public void setFinancialCode(String financialCode) {
            this.financialCode = financialCode;
        }

        public String getGrundlagen() {
            return grundlagen;
        }

        public void setGrundlagen(String grundlagen) {
            this.grundlagen = grundlagen;
        }

        public String getImage() {
            String imagePath = "";
            if (!TextUtils.isEmpty(image)) {
                imagePath = "http://" + Url.IP + image;
            }
            return imagePath;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public String getModel() {
            return model;
        }

        public void setModel(String model) {
            this.model = model;
        }

        public String getPlace() {
            return place;
        }

        public void setPlace(String place) {
            this.place = place;
        }

        public String getReceiver() {
            return receiver;
        }

        public void setReceiver(String receiver) {
            this.receiver = receiver;
        }

        public String getReceivesdate() {
            return receivesdate;
        }

        public void setReceivesdate(String receivesdate) {
            this.receivesdate = receivesdate;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getRfid() {
            return rfid;
        }

        public void setRfid(String rfid) {
            this.rfid = rfid;
        }

        public String getSalvage() {
            return salvage;
        }

        public void setSalvage(String salvage) {
            this.salvage = salvage;
        }

        public String getSource() {
            return source;
        }

        public void setSource(String source) {
            this.source = source;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getSupplier() {
            return supplier;
        }

        public void setSupplier(String supplier) {
            this.supplier = supplier;
        }

        public String getTeam() {
            return team;
        }

        public void setTeam(String team) {
            this.team = team;
        }

        public String getType() {

                return type;
//            return type;
        }

        public void setType(String type) {
            this.type = type;


        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }

        public String getUsedate() {
            return usedate;
        }

        public void setUsedate(String usedate) {
            this.usedate = usedate;
        }

        public String getUserDept() {
            return userDept;
        }

        public void setUserDept(String userDept) {
            this.userDept = userDept;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getYear() {
            return year;
        }

        public void setYear(String year) {
            this.year = year;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.admin);
            dest.writeString(this.amount);
            dest.writeString(this.area);
            dest.writeString(this.assetId);
            dest.writeString(this.assetName);
            dest.writeString(this.assetNumber);
            dest.writeString(this.brand);
            dest.writeString(this.company);
            dest.writeString(this.createUser);
            dest.writeString(this.createdate);
            dest.writeString(this.deptId);
            dest.writeString(this.division);
            dest.writeString(this.financialCode);
            dest.writeString(this.grundlagen);
            dest.writeString(this.image);
            dest.writeString(this.model);
            dest.writeString(this.place);
            dest.writeString(this.receiver);
            dest.writeString(this.receivesdate);
            dest.writeString(this.remark);
            dest.writeString(this.rfid);
            dest.writeString(this.salvage);
            dest.writeString(this.source);
            dest.writeString(this.status);
            dest.writeString(this.supplier);
            dest.writeString(this.team);
            dest.writeString(this.type);
            dest.writeString(this.unit);
            dest.writeString(this.usedate);
            dest.writeString(this.userDept);
            dest.writeString(this.userId);
            dest.writeString(this.year);
            dest.writeString(this.accountant);
        }

        public AssetBean() {
        }

        protected AssetBean(Parcel in) {
            this.admin = in.readString();
            this.amount = in.readString();
            this.area = in.readString();
            this.assetId = in.readString();
            this.assetName = in.readString();
            this.assetNumber = in.readString();
            this.brand = in.readString();
            this.company = in.readString();
            this.createUser = in.readString();
            this.createdate = in.readString();
            this.deptId = in.readString();
            this.division = in.readString();
            this.financialCode = in.readString();
            this.grundlagen = in.readString();
            this.image = in.readString();
            this.model = in.readString();
            this.place = in.readString();
            this.receiver = in.readString();
            this.receivesdate = in.readString();
            this.remark = in.readString();
            this.rfid = in.readString();
            this.salvage = in.readString();
            this.source = in.readString();
            this.status = in.readString();
            this.supplier = in.readString();
            this.team = in.readString();
            this.type = in.readString();
            this.unit = in.readString();
            this.usedate = in.readString();
            this.userDept = in.readString();
            this.userId = in.readString();
            this.year = in.readString();
            this.accountant = in.readString();
        }

        public static final Creator<AssetBean> CREATOR = new Creator<AssetBean>() {
            @Override
            public AssetBean createFromParcel(Parcel source) {
                return new AssetBean(source);
            }

            @Override
            public AssetBean[] newArray(int size) {
                return new AssetBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.state);
        dest.writeParcelable(this.asset, flags);
    }

    public QueryData() {
    }

    protected QueryData(Parcel in) {
        this.state = in.readString();
        this.asset = in.readParcelable(AssetBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<QueryData> CREATOR = new Parcelable.Creator<QueryData>() {
        @Override
        public QueryData createFromParcel(Parcel source) {
            return new QueryData(source);
        }

        @Override
        public QueryData[] newArray(int size) {
            return new QueryData[size];
        }
    };
}
